package com.zxt.mapper;

import com.zxt.bean.NameBean;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by XiaoQiAng on 2015/11/7.
 */
public class NameMapper implements DataMapper{
    ResultSet rs = null;
    @Override
    public List<NameBean> rowMapper(ResultSet rs) {
        this.rs = rs;
        List<NameBean> list = new ArrayList<>();
        try {
            while (rs.next()) {
                NameBean nameBean = new NameBean();
                nameBean.setName(rs.getString("name"));
                list.add(nameBean);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }
}
